package gongshw.comic;

import java.util.ArrayList;
import java.util.HashMap;

public class ComicIndex {
	private String name[];
	private String urlTail[];
	private String lastCapter[];
	public ComicIndex(String urlIndex){
		IndexGetter.requsetComicIndex(urlIndex);
		name = IndexGetter.getComicIndexName();
		urlTail = IndexGetter.getComicIndexUrl();
		lastCapter = IndexGetter.getLatChapterList();
	}
	
	public String[] getName(){
		return name;
	}
	
	public String[] getUrlTail(){
		return urlTail;
	}
	
	public String[] getLastCapter(){
		return lastCapter;
	}
	
	public ArrayList<HashMap<String,Object>> getBindData(){
		ArrayList<HashMap<String,Object>> listItem = new ArrayList<HashMap<String,Object>>();
		int length = lastCapter.length;
		for(int i = 0;i<length;i++){
			HashMap<String,Object> map = new HashMap<String,Object>();
			map.put("name", name[i]);
			map.put("lastCapter", lastCapter[i]);
			listItem.add(map);
		}
		return listItem;
	}
}
